package eft.android.view;

import java.util.ArrayList;

import me.croute.calendarexample.R;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import eft.android.controller.Controller;

public class DayView extends Activity{
	
	private Controller controller;
	ArrayList<String> exerciseList=new ArrayList<String>();
	ArrayAdapter<String> adapter = null;

	public void onCreate (Bundle savedInstanceState) {
		try {
			super.onCreate(savedInstanceState);
			setContentView(R.layout.dayview);
			
			Button addWorkout = (Button) findViewById(R.id.dayViewAddWorkout);
            Button addWeight = (Button) findViewById(R.id.dayViewAddWeight);
            
            addWorkout.setOnClickListener(dayViewAddWorkout);
            addWeight.setOnClickListener(dayViewAddWeight);
			
            controller = Controller.getInstance();
            
			adapter = new ArrayAdapter<String>(this, R.id.dayViewList, exerciseList);
			//listitems.add(controller.getDayWorkouts(date));
			adapter.notifyDataSetChanged();
            
			

          
			/* Initialize the Model, View, and Controller classes
			//	final CalcManager myModel = new CalcManager();
			//		final MyView myView = new MyView(this);
			//	MyController myController =
			//		new MyController(this, myModel, myView);
			//	ViewGroup container = 
			//		(ViewGroup) findViewById(R.id.myLayout);
			//	container.addView(myView);
			//	container.addView(myController); 
			*/
		}
		catch (Exception e) {
			Log.e("ERROR", "ERROR IN CODE: " + e.toString());
			e.printStackTrace();
		}
	}
	
    /** Create click listeners for buttons */
    private View.OnClickListener dayViewAddWorkout = new View.OnClickListener() {
		
		public void onClick(View v) {
		//Go to Add workout page
		}
	};
    
	private View.OnClickListener dayViewAddWeight = new View.OnClickListener() {
		
		public void onClick(View v) {
		//Go to Add weight page
		}
	};
    



}
